import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data:data,
    headers:{
      'Content-Type':'form-data'
    }
  })
}

export function getInfo(token) {
  return request({
    url: '/admin/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/admin/logout',
    method: 'post',
    headers:{
      'Content-type':'form-data'
    }
  })
}


export function addAdmin(data) {
  return request({
    url: '/admin/admin',
    method: 'put',
    data,
    headers:{
      'Content-type':'form-data'
    }
  })
}

export function editAdmin(data) {
  return request({
    url: '/admin/admin',
    method: 'post',
    data,
    headers:{
      'Content-type':'form-data'
    }
  })
}


export function deleteAdmin(data) {
  return request({
    url: '/admin/admin',
    method: 'delete',
    params:data
  })
}


export function getAdminList(){
  return request({
    url:'admin/adminList',
    method:'get',
  })
}